#define DEBUG
#include <cstdio>
#define MAXN 2000
#define MAXK 10

using namespace std;

int min(int a, int b) {
  return a<b ? a : b;
}

int max(int a, int b) {
  return a>b ? a : b;
}

int main() {
#ifdef DEBUG
  freopen("4779.in", "r", stdin);
  freopen("4779.out", "w", stdout);
#endif

  static long long f[MAXN+1][MAXK+1], c[MAXN+1][MAXN+1], power[MAXK+1][MAXN*MAXN+1], fact[MAXN+1];
  int n, m, k, l, t, temp;
  scanf("%d %d %d %d", &n, &m, &k, &l);
  t=min(n, m), temp=max(n, m);
  fact[0]=1;
  for (int i=1; i<=t; i++) {
    fact[i] = fact[i-1]*i%l;
  }
  for (int i=1; i<=k; i++) {
    power[i][0]=1;
    for (int j=1; j<=n*m; j++) {
      power[i][j] = power[i][j-1]*i%l;
    }
  }
  for (int i=0; i<=temp; i++) {
    c[i][0]=1;
    for (int j=1; j<=i; j++) {
      c[i][j] = (c[i-1][j]+c[i-1][j-1])%l;
    }
  }

  static long long sum[MAXN+1][MAXK+1];
  f[0][1] = 1;
  for (int i=1; i<=k; i++) {
    sum[0][i] = 1;
  }
  for (int i=1; i<=t; i++) {
    sum[i][0]=0;
    for (int j=1; j<=k; j++) {
      for (int p=1; p<=i; p++) {
	f[i][j] = (f[i][j]+(sum[i-p][j-1]*c[i][p]%l*power[j-1][(n-i+p)*(m-i+p)-(n-i)*(m-i)-p]%l))%l;
	sum[i][j] = (f[i][j]+sum[i][j-1])%l;
      }
    }
  }

  long long ans=0;
  for (int i=1, p=1; i<=t; i++, p=-p) {
    for (int j=1; j<=k; j++) {
      ans = (ans+(f[i][j]*c[n][i]%l*c[m][i]%l*fact[i]%l*power[k][(n-i)*(m-i)]%l)*p+l)%l;
    }
  }
  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
} 
